############
SieveManager
############

.. image:: https://www.bestpractices.dev/badge_static/97
   :target: https://www.bestpractices.dev/en/projects/8336
   :alt: OpenSSF best practices badge

SieveManager is a command-line client for uploading, downloading,
and managing remote Sieve_ scripts using the ManageSieve protocol.
It can also be used as a Python module.

Sieve is a programming language for filtering email. Sieve scripts are
typically run by the mail server when mail is delivered to an inbox,
which is why they need to be  managed remotely.

.. warning::
    SieveManager is a work in progress. The command-line interface,
    the configuration semantics, and the Python API are subject to change.
    And it's probably buggy.


EXAMPLE
=======

Upload and activate a Sieve script:

.. code:: none

    $ sievemgr user@imap.foo.example
    user@imap.foo.example's password: <password>
    sieve://user@imap.foo.example> put script.sieve
    sieve://user@imap.foo.example> activate script.sieve

In Python:

.. code:: python

    from sievemgr import SieveManager
    with SieveManager('imap.foo.example') as mgr:
        mgr.authenticate('user', 'password')
        with open('sieve.script', 'br') as script:
            mgr.putscript(script, 'sieve.script')
        mgr.setactive('sieve.script')


FEATURES
========

* Complies fully with :rfc:`5804` (ManageSieve protocol)

* Login can be automated with:
  
  * password managers
  * GnuPG-encrypted password files
  * :doc:`sieve.cf <config>`
  * `.netrc <netrc_>`_

* Password-based authentication with:

  * CRAM-MD5
  * LOGIN
  * PLAIN
  * SCRAM-SHA-(1|224|256|384|512)
  * SCRAM-SHA-(1|224|256|384|512)-PLUS [#untested]_
  * SCRAM-SHA3-512
  * SCRAM-SHA3-512-PLUS [#untested]_

* TLS client authentication

* Proxy authentication

* Tab-completion

* Scriptable

* Sieve scripts can be backed up automatically

* Checks whether TLS certificates have been revoked
  (using lightweight OCSP_)

* Supports TLS `Server Name Indication`_

* Supports giving IPv6 addresses on the command-line


.. [#untested] Untested.


.. toctree::
   :hidden:
   :titlesonly:

   install
   command
   config
   module
   security
   feedback
   contrib
   Change log <changelog>
   Licence <licence>
   genindex
